<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">


<!-- source http://www.scnoob.com More templates http://www.scnoob.com/moban -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>佛大叮当</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Favicon -->
    <link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon" href="/img/icon.png">

    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/plugins.css">
    <!-- Style Css -->
    <link rel="stylesheet" href="/css/style.css">
    <!-- Custom Styles -->
    <link rel="stylesheet" href="/css/custom.css">


    <!-- Js Files -->
    <script src="/js/jquery-3.4.1.slim.min.js"></script>
    <script src="/js/modernizr-3.6.0.min.js"></script>
    <script src="/js/plugins.js"></script>
    <script src="/js/main.js"></script>
    <script src="/js/popper.min.js"></script>
    <script src="/js/bootstrap.min.js" type="application/javascript"></script>

</head>
<body>
<!-- Add your site or application content here -->

<!-- Wrapper -->
<div id="wrapper" class="wrapper">
    <!-- Header -->
    <header class="header sticky-header">

        <div id="head" th:include="common/template :: common_head"></div>


        <!-- Header Middle Area -->
        <div class="header-middle-area cr-border cr-border-bottom">
            <div class="container">
                <div class="row align-items-center">
                    <div class="col-lg-4 col-12">
                        <form class="header-search" th:action="@{/search}" method="post">
                            <input type="text" placeholder="搜索闲置...." name="query"
                                   th:value="${query}">
                            <button type="submit"><img src="/imgs/icon/search.svg"></button>
                        </form>
                    </div>
                    <div class="col-lg-4 col-md-6 col-sm-7 col-12">
                        <div class="header-logo">
                            <a href="index.html">
                                <img src="imgs/logo2.png" alt="logo">
                            </a>
                        </div>
                    </div>
                    <div class="col-lg-2 col-md-3 col-sm-4 col-12">
                        <a class="btn btn-outline-warning btn-lg btn-block" href="product-input"
                           role="button">发 布</a>
                    </div>
                </div>
            </div>
        </div>
        <!--// Header Middle Area -->
    </header>
    <!--// Header -->

    <div class="btn-group-vertical float-left">
        <a type="button" class="btn btn-primary" th:href="@{/index}">全部</a>
        <a type="button" class="btn btn-secondary" th:href="@{/index/{type}(type='书籍类')}">书籍类
        </a>
        <a type="button" class="btn btn-success" th:href="@{/index/{type}(type='生活类')}">生活类
        </a>
        <a type="button" class="btn btn-danger" th:href="@{/index/{type}(type='电器类')}">电器类</a>
        <a type="button" class="btn btn-warning" th:href="@{/index/{type}(type='衣物类')}">衣物类
        </a>
        <a type="button" class="btn btn-info" th:href="@{/index/{type}(type='化妆类')}">化妆类</a>
    </div>


    <!-- Page Conttent -->
    <main class="page-content">
        <!-- Fullwidth Shop Area -->
        <div class="shop-area bg-white section-padding-bottom-md">
            <div class="container">
                <h2><span class="badge badge-warning"  th:text="${type}"></span></h2>
                <!-- Shop Page Products -->
                <div class="row justify-content-center shop-page-products products-wrapper">
                    <!-- Single Product -->
                    <div class="col-xl-3 col-lg-4 col-md-4 col-sm-6 col-12"
                         th:each="product : ${page}">
                        <div class="product-item">
                            <div class="product-item-images">
                                <p class="product-item-image-inner">
                                    <img th:if="${product.imgs.size()>0}"
                                         th:src="${product.imgs.get(0)}">
                                    <!--<img src="/asdfasdf/闲置交易.png">-->
                                </p>
                                <p class="add-to-cart-button">
                                    <a href="#" th:href="@{/product/{id}(id=${product.id})}"><span>进去看看
                                </span></a>
                                </p>
                            </div>
                            <div class="product-item-content">
                                <div class="product-item-content-left">
                                    <h5><a href="product-details-right-sidebar.html"
                                           th:text="${product.title}"></a></h5>
                                    <div class="price-box">
                                        <span class="pricebox-price"
                                              th:text="${product.price}"></span>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>


                <!--<div class="shop-page-toolbars shop-page-toolbars-bottom" th:if="${page.totalPages}>1">-->
                <div class="shop-page-toolbars shop-page-toolbars-bottom" th:if="${page.totalPages}!=null">
                    <ul class="shop-toolbar-pagination" th:if="${page.totalPages}>1">
                        <li class="active">
                            <a class="btn btn-warning btn-lg" role="button" th:href="@{index(page=${page.number}-1)}" th:unless="${page.first}">上一页</a>
                        </li>
                        <li>
                            <a class="btn btn-warning btn-lg" role="button" th:href="@{index(page=${page.number}+1)}" th:unless="${page.last}">下一页</a>
                        </li>
                    </ul>

                </div>
                <!--// Shop Page Toolbars -->

            </div>
        </div>
        <!--// Fullwidth Shop Area -->
        <!--// Page Conttent -->
    </main>
</div>

</body>


<!-- source http://www.scnoob.com More templates http://www.scnoob.com/moban -->
</html>